package com.zhiche.lisa.tms.dto;

import com.google.common.collect.Lists;
import com.zhiche.lisa.tms.dao.model.ShipOrder;
import com.zhiche.lisa.tms.dao.model.ShipOrderItem;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * Created by zhaoguixin on 2018/7/12.
 */
public class ShipOrderDTO {

    private ShipOrder shipOrder;

    private List<ShipOrderItem> shipOrderItemList;


    public ShipOrder getShipOrder() {
        return shipOrder;
    }

    public void setShipOrder(ShipOrder shipOrder) {
        this.shipOrder = shipOrder;
    }

    public List<ShipOrderItem> getShipOrderItemList() {
        return shipOrderItemList;
    }

    public void setShipOrderItemList(List<ShipOrderItem> shipOrderItemList) {
        this.shipOrderItemList = shipOrderItemList;
    }

    public void addShipOrderItem(ShipOrderItem shipOrderItem){
        if( CollectionUtils.isEmpty(shipOrderItemList)){
            shipOrderItemList = Lists.newArrayList();
        }
        shipOrderItemList.add(shipOrderItem);
    }
}
